<?php

class Player extends CActiveRecord
{
    public $id;

    public $position;

    public $hand;

    public $league;

    public $height;

    public $weight;

    public $status;

    public $national;

    public $achievements;

    public function relations()
    {
        return array(
            'person' => array(self::BELONGS_TO, 'Person', 'person_id'),
            'teams' => array(self::HAS_MANY, 'Team', 'player_id')
        );
    }

    public function tableName()
    {
        return 'players';
    }

    public static function model($className = __CLASS__)
    {
        return parent::model($className);
    }
}